import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'layout',
    redirect:'/home',
    component: () => import(/* webpackChunkName: "about" */ '@/views/layout/indexView.vue'),
    children:[{
      path:'/home',
      name:'home',
      component:()=>import('@/views/home/indexView.vue')
    },{
      path:'/list',
      name:'list',
      component:()=>import('@/views/list/indexView.vue')
    },{
      path:'/user',
      name:'user',
      component:()=>import('@/views/user/indexView.vue')
    },]
  },{
    path:'/text:id',
    name:'text',
    component:()=>import('@/views/text/indexView.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
